﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="search.ascx.cs" Inherits="Views_module_search" %>
<script type="text/javascript">
    $(function () {
        $("#<%=txtAutoCompleteSearch.ClientID%>").AutoComplete("searchResult.aspx?searchword=", { minChars: 3, delay: 300 });
    });
</script>
<div class="top">Tìm kiếm nâng cao</div>
    <div class="middle">
        <div id="content_search" style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 3px; margin-bottom: 10px;">
          <table>
            <tr>
              <td>Từ khóa: 
                <input type="text" id="txtAutoCompleteSearch" name="searchField" runat="Server" style="width: 200px" />

                <asp:DropDownList ID="categoryList" runat="server">
                </asp:DropDownList>

                <asp:DropDownList ID="price" runat="server">
                    <asp:ListItem Text="Tìm theo giá" Value="0" Selected="True" />
                    <asp:ListItem Text="< 100.000đ" Value="100000" Selected="false" />
                    <asp:ListItem Text="< 500.000đ" Value="500000" Selected="false" />
                    <asp:ListItem Text="< 1000.000đ" Value="1000000" Selected="false" />
                    <asp:ListItem Text="< 2000.000đ" Value="2000000" Selected="false" />
                    <asp:ListItem Text="< 5000.000đ" Value="5000000" Selected="false" />
                    <asp:ListItem Text="> 5000.000đ" Value="1000000000" Selected="false" />
                </asp:DropDownList>
              </td>
            </tr>
            <tr>
              <td>
                <input type="checkbox" name="description" id="description" runat="Server" />
                Tìm trong chi tiết sản phẩm
              </td>
            </tr>
          </table>
        </div>
        <div class="buttons">
          <table>
            <tr>
              <td align="right"><asp:button ID="btnSearch" Text="Tìm" runat="Server" CssClass="button" onclick="btnSearch_Click" /></td>
            </tr>
          </table>
        </div>
        <div ID="divResult" runat="Server">
            <ul class="tabs">
                <li><a href="#Product_Result">Các sản phẩm tìm thấy</a></li>
            </ul>
            <div class="tab_container"> 
                <div id="Product_Result" class="tab_content">
                    <asp:datalist ID="Product_Result" runat="Server" RepeatColumns="3">
                        <ItemTemplate>
                            <table>
                                <tr>
                                    <td width="25%">
                                        <a href="#"><img class="thumb" src='images/<%# Eval("image") %>' Width="140px" height="140px" /></a><br />
                                        <a href='product.aspx?id=<%# Eval("product_id") %>'><%# Eval("product_name") %></a><br />
                                        Mô tả: <asp:label ID="des" Text='<%# Eval("product_des")%>' Width="100px" runat="Server" /><br />
                                        Giá: <span style="color: #900; font-weight: bold;"><%# Eval("price") %></span><br />
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:datalist>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">&nbsp;</div>